<template>
  <!--企业员工-->
  <a-modal  :maskClosable="false"
            title="企业员工"
            :width="1000"
            @ok="mdl.visible = false"
            v-model="mdl.visible"
  >
    <!--列表-->
    <a-table :columns="columns" :dataSource="data"
             bordered size="small" rowKey="id"
             :loading="loading"
             @change="getTableData"
    ></a-table>
  </a-modal>
</template>
<script>
  import {companyInfoBasequeryUsers} from '@/api/business'
  export default {
    components: {

    },
    props: {
      /*   -------弹窗--------*/
      mdl: [Array,Object,String],
    },
    data() {
      return {
        /*   -------表格--------*/
        loading: false,
        columns:[
          {
            title: '姓名',
            dataIndex: 'userName'
          },
          {
            title: '昵称',
            dataIndex: 'nickname'
          },
          {
            title: '岗位',
            dataIndex: 'job',
          },
          {
            title: '手机号',
            dataIndex: 'tel',
          },
          {
            title: '微信号',
            dataIndex: 'wechat',
          },
          {
            title: '身份证号码',
            dataIndex: 'idCard',
          },
          {
            title: '注册时间',
            dataIndex: 'createTime',
          },
//          {
//            title: '已学课时',
//            dataIndex: 'period'
//          },
          {
            title: '已得积分',
            dataIndex: 'integral'
          },
//          {
//            title: '操作',
//            dataIndex: 'action',
//            width: '150px',
//            scopedSlots: {customRender: 'action'}
//          }
        ],
        data:[],

      }
    },
    inject: ['upShow'],

    created() {

    },
    watch: {
      id() {
          this.getTableData()
      }
    },
    computed: {
      id() {
          return this.mdl.id
      }
    },
    methods: {
      getTableData() {
        this.loading = true
        companyInfoBasequeryUsers(this.mdl.id).then(res => {
          this.loading = false
          this.data = res.data
        }).catch(err => {
          this.loading = false
        })
      },
    }
  }
</script>